package com.wyl.customui.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.wyl.customui.R
import kotlinx.android.synthetic.main.sample_input_number_view.*


/**
 * A simple [Fragment] subclass.
 * Use the [InputNumberSimpleFragment.newInstance] factory method to
 * create an instance of this fragment.
 */
class InputNumberSimpleFragment : Fragment() {

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.sample_input_number_view, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        textView.text = inputNumberView.count.toString()

        inputNumberView.onNumChange = {
            textView.text = it.toString()
        }
    }

}